﻿using System;
using System.Reflection;
using System.Windows.Forms;

namespace todo
{
    public partial class ReminderSetterForm : Form
    {
        private ReminderSetterHost host;

        public ReminderSetterForm()
        {
            InitializeComponent();

            //
            var exe = Assembly.GetExecutingAssembly().Location;
            var url = @"res://" + exe + "/reminder.html";

            host = new ReminderSetterHost();
            host.OnClose += host_OnClose;
            www.ObjectForScripting = host;
            www.Navigate(url);

#if zh
            this.Text = "设置提醒";
#endif
        }

        private void host_OnClose(object sender, EventArgs e)
        {
            this.Close();
        }

        public string Reminders
        {
            get { return host.getReminders(); }
            set
            {
                Console.WriteLine("?");
                host.setReminders(value);
            }
        }
    }
}